Defer setting the parent until the window is shown, otherwise it gets
authorRichard Hult <richard@imendio.com>
Sat, 16 Jun 2007 21:21:52 +0000 (21:21 +0000)
committerRichard Hult <rhult@src.gnome.org>
Sat, 16 Jun 2007 21:21:52 +0000 (21:21 +0000)
2007-06-16  Richard Hult  <richard@imendio.com>

* gdk/quartz/gdkwindow-quartz.c: (gdk_window_set_transient_for):
Defer setting the parent until the window is shown, otherwise it
gets unconditionally shown here.

svn path=/trunk/; revision=18164

ChangeLog
gdk/quartz/gdkwindow-quartz.c

index fcd4e5193529f151328a8876f282f0ad51441e58..a7d7b1922448c2080bb0a8d776605d82ca991f7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-06-16  Richard Hult  <richard@imendio.com>
+
+       * gdk/quartz/gdkwindow-quartz.c: (gdk_window_set_transient_for):
+       Defer setting the parent until the window is shown, otherwise it
+       gets unconditionally shown here.
+
 2007-06-16  Johan Dahlin  <jdahlin@async.com.br>
 
        * gtk/gtkbuilderparser.c (text): Swap argument order to dgettext
index 5329ff0cf11ab10851a58577a663fd388cb52a5a..f538e2100f7745f9ea98c0be5e20c8476d1b7437 100644 (file)
@@ -1585,7 +1585,13 @@ gdk_window_set_transient_for (GdkWindow *window,
       if (gdk_window_get_type_hint (window) != GDK_WINDOW_TYPE_HINT_TOOLTIP)
         {
           window_impl->transient_for = g_object_ref (parent);
-          [parent_impl->toplevel addChildWindow:window_impl->toplevel ordered:NSWindowAbove];
+
+          /* We only add the window if it is shown, otherwise it will
+           * be shown unconditionally here. If it is not shown, the
+           * window will be added in show() instead.
+           */
+          if (!(GDK_WINDOW_OBJECT (window)->state & GDK_WINDOW_STATE_WITHDRAWN))
+            [parent_impl->toplevel addChildWindow:window_impl->toplevel ordered:NSWindowAbove];
         }
     }